import { ipcMain } from "electron";
import { clientInstanceService } from "~/service";

ipcMain.handle("/api/client/instance/info", async (_e, payload) => {
  const { id } = payload;
  return clientInstanceService.info(id);
});

ipcMain.handle("/api/client/instance/get_state", async (_e, payload) => {
  const { id, url } = payload;
  return clientInstanceService.getState(id, url);
});

ipcMain.handle("/api/client/instance/cluster_health", async (_e, payload) => {
  const { id } = payload;
  return clientInstanceService.clusterHealth(id);
});
